package refactoring.replaceSubclassWithDelegate;

/**
 * <描述>
 *
 * @author timothy.yang cloudwise
 * @since 2022-05-23 23:09
 */
public class AfricanSwallow extends Bird {

    private final Integer numberOfCoconuts;

    public AfricanSwallow(BirdParam birdParam) {
        super(birdParam);
        this.numberOfCoconuts = birdParam.getNumberOfCoconuts();
    }

    @Override
    public Integer airSpeedVelocity() {
        return 40 - 2 * this.numberOfCoconuts;
    }
}
